﻿using System;
using BridgeUI;
using UnityEngine;

///*************************************************************************************
///* 作    者：       邹杭特
///* 创建时间：       2019-03-10 05:05:27
///* 说    明：       1.此代码由工具生成
///                   2.不支持编写的代码
///                   3.请使用继承方式使用
///* ************************************************************************************/
namespace GView
{
	/// <summary>
	/// 模板方法
	/// <summary>
	public abstract class SubPanel0_Internal:BridgeUI.Binding.BindingSubPanel
	{
		private SubPanel0_Reference binding;

		/// <summary>
		/// 绑定
		/// </summary>
		public override void Binding(BridgeUI.Binding.BindingReference target)
		{
			if (binding != null && target is SubPanel0_Reference)
			{
				binding = target as SubPanel0_Reference;
				binding.Button.onClick.AddListener(On_onClick);
				Set_text_color(binding.text_color);
			}
		}

		/// <summary>
		/// 解绑定
		/// </summary>
		public override void UnBinding()
		{
			if (binding != null)
			{
				binding.Button.onClick.RemoveListener(On_onClick);
			}
		}
		
		#region Set_Functions
		protected void Set_text_color(UnityEngine.Color text_color)
		{
			if (binding)
			{
				if (binding.Text != null)
				{
					binding.Text.color = text_color;
				}
			}
		}
		#endregion Set_Functions
		
		#region Abstruct_Functions
		protected abstract void On_onClick();
		#endregion Abstruct_Functions
	}
}
